Func Cutlass_Button()

	$cstate1 = GUICtrlRead( $Cutlass_Combo1)
	$cstate2 = GUICtrlRead( $Cutlass_Combo2)
	$cstate3 = GUICtrlRead( $Cutlass_Combo3)
	$cstate4 = GUICtrlRead( $Cutlass_Combo4)
	$cstate5 = GUICtrlRead( $Cutlass_Combo5)

        if $cstate1 = $GUI_CHECKED then 
		$Cutlass_data_1 = Sqrt(GUICtrlRead($Cutlass_Combo_1)*GUICtrlRead($Cutlass_Combo_1))
		$Cutlass_data_2 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
		$Cutlass_data_3 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
		$Cutlass_data_4 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
		$Cutlass_data_5 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))

        elseif $cstate2 = $GUI_CHECKED then 
		$Cutlass_data_1 = Sqrt(GUICtrlRead($Cutlass_Combo_1)*GUICtrlRead($Cutlass_Combo_1))
		$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
		$Cutlass_data_3 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
		$Cutlass_data_4 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
		$Cutlass_data_5 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))

        elseif $cstate3 = $GUI_CHECKED then 
		$Cutlass_data_1 = Sqrt(GUICtrlRead($Cutlass_Combo_1)*GUICtrlRead($Cutlass_Combo_1))
		$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
		$Cutlass_data_3 = Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
		$Cutlass_data_4 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
		$Cutlass_data_5 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))

        elseif $cstate4 = $GUI_CHECKED then 
      	$Cutlass_data_1 = Sqrt(GUICtrlRead($Cutlass_Combo_1)*GUICtrlRead($Cutlass_Combo_1))
		$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
		$Cutlass_data_3 = Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
		$Cutlass_data_4 = Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
		$Cutlass_data_5 = "-" & Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))

        elseif $cstate5 = $GUI_CHECKED then 
		$Cutlass_data_1 = Sqrt(GUICtrlRead($Cutlass_Combo_1)*GUICtrlRead($Cutlass_Combo_1))
		$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
		$Cutlass_data_3 = Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
		$Cutlass_data_4 = Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
		$Cutlass_data_5 = Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))
	Endif

	$cstate6 = GUICtrlRead($Cutlass_Special_1)
        if $cstate6 = $GUI_CHECKED then 
	    	$Cutlass_data_6 = Sqrt(GUICtrlRead($Cutlass_Special1)*GUICtrlRead($Cutlass_Special1))
	  elseif $cstate6 = $GUI_UNCHECKED then 
	    	$Cutlass_data_6 = ("-" & Sqrt(GUICtrlRead($Cutlass_Special1)*GUICtrlRead($Cutlass_Special1)))
	  EndIf


	IniWrite ( "attackhack.ini", "cutlass", "combo1delay", $Cutlass_data_1 )
	IniWrite ( "attackhack.ini", "cutlass", "combo2delay", $Cutlass_data_2 )
	IniWrite ( "attackhack.ini", "cutlass", "combo3delay", $Cutlass_data_3 )
	IniWrite ( "attackhack.ini", "cutlass", "combo4delay", $Cutlass_data_4 )
	IniWrite ( "attackhack.ini", "cutlass", "combo5delay", $Cutlass_data_5 )
	IniWrite ( "attackhack.ini", "cutlass", "specialdelay", $Cutlass_data_6 )
	

	  
EndFunc
	
Func Cut_Combo1()

		GUICtrlSetState($Cutlass_Combo_2, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_2, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Combo_3, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_3, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Combo_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Combo_5, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_5, $GUI_DISABLE)
      IniWrite ( "attackhack.ini", "cutlass", "combo2delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))))
      IniWrite ( "attackhack.ini", "cutlass", "combo3delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))))
      IniWrite ( "attackhack.ini", "cutlass", "combo4delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))))
      IniWrite ( "attackhack.ini", "cutlass", "combo5delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))))

EndFunc

Func Cut_Combo2()
		GUICtrlSetState($Cutlass_Combo_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_3, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_3, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Combo_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Combo_5, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_5, $GUI_DISABLE)
 
	$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
      IniWrite ( "attackhack.ini", "cutlass", "combo2delay", $Cutlass_data_2)
      IniWrite ( "attackhack.ini", "cutlass", "combo3delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))))
      IniWrite ( "attackhack.ini", "cutlass", "combo4delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))))
      IniWrite ( "attackhack.ini", "cutlass", "combo5delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))))

EndFunc

Func Cut_Combo3()
		GUICtrlSetState($Cutlass_Combo_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Combo_5, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_5, $GUI_DISABLE)

	$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
	$Cutlass_data_3 = Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
      IniWrite ( "attackhack.ini", "cutlass", "combo2delay", $Cutlass_data_2)
      IniWrite ( "attackhack.ini", "cutlass", "combo3delay", $Cutlass_data_3)
      IniWrite ( "attackhack.ini", "cutlass", "combo4delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))))
      IniWrite ( "attackhack.ini", "cutlass", "combo5delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))))
EndFunc

Func Cut_Combo4()
		GUICtrlSetState($Cutlass_Combo_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_4, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_4, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_5, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_5, $GUI_DISABLE)

	$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
	$Cutlass_data_3 = Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
	$Cutlass_data_4 = Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
      IniWrite ( "attackhack.ini", "cutlass", "combo2delay", $Cutlass_data_2)
      IniWrite ( "attackhack.ini", "cutlass", "combo3delay", $Cutlass_data_3)
      IniWrite ( "attackhack.ini", "cutlass", "combo4delay", $Cutlass_data_4)
      IniWrite ( "attackhack.ini", "cutlass", "combo5delay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))))

EndFunc

Func Cut_Combo5()
		GUICtrlSetState($Cutlass_Combo_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_4, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_4, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Combo_5, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_5, $GUI_ENABLE)
	$Cutlass_data_2 = Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))
	$Cutlass_data_3 = Sqrt(GUICtrlRead($Cutlass_Combo_3)*GUICtrlRead($Cutlass_Combo_3))
	$Cutlass_data_4 = Sqrt(GUICtrlRead($Cutlass_Combo_4)*GUICtrlRead($Cutlass_Combo_4))
	$Cutlass_data_5 = Sqrt(GUICtrlRead($Cutlass_Combo_5)*GUICtrlRead($Cutlass_Combo_5))
      IniWrite ( "attackhack.ini", "cutlass", "combo2delay", $Cutlass_data_2)
      IniWrite ( "attackhack.ini", "cutlass", "combo3delay", $Cutlass_data_3)
      IniWrite ( "attackhack.ini", "cutlass", "combo4delay", $Cutlass_data_4)
      IniWrite ( "attackhack.ini", "cutlass", "combo5delay", $Cutlass_data_5)

EndFunc

Func Cut_SpecialDelay()

        $cstate = GUICtrlRead( $Cutlass_Special_1)
        if $cstate = $GUI_UNCHECKED then 
		GUICtrlSetState($Cutlass_Special1, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_6, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Special_2, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_7, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Special_3, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_8, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Special_4, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_9, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Special_5, $GUI_DISABLE)
		GUICtrlSetState($Cutlass_Label_10, $GUI_DISABLE)
	      IniWrite ( "attackhack.ini", "cutlass", "specialdelay", ( "-" &Sqrt(GUICtrlRead($Cutlass_Combo_2)*GUICtrlRead($Cutlass_Combo_2))))
        elseif $cstate = $GUI_CHECKED then 
		GUICtrlSetState($Cutlass_Special1, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_6, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Special_2, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_7, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Special_3, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_8, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Special_4, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_9, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Special_5, $GUI_ENABLE)
		GUICtrlSetState($Cutlass_Label_10, $GUI_ENABLE)
		$Cutlass_data_6 = GUICtrlRead($Cutlass_Special1)
	    IniWrite ( "attackhack.ini", "cutlass", "specialdelay", $Cutlass_data_6)
   	 EndIf

EndFunc

Func Cutlass_Special()
;Sweep 1
;Brawl 2
;Taunt 3
;Storm 4


	$cstate1 = GUICtrlRead($Cutlass_Special_2)
	$cstate2 = GUICtrlRead($Cutlass_Special_3)
	$cstate3 = GUICtrlRead($Cutlass_Special_4)
	$cstate4 = GUICtrlRead($Cutlass_Special_5)
	

	$special = ""
	If $cstate1 = $GUI_CHECKED Then
		$special = $special & "1"
	EndIf
	
	If $cstate2 = $GUI_CHECKED Then
		$special = $special & "2"
	EndIf

	If $cstate3 = $GUI_CHECKED Then
		$special = $special & "3"
	EndIf

	If $cstate4 = $GUI_CHECKED Then
		$special = $special & "4"
	EndIf
	
		IniWrite ( "attackhack.ini", "cutlass", "specials", $special)

EndFunc

Func cutlass()
	If (WinActive("Pirates")) Then
		$cutlassinfo = IniReadSection("attackhack.ini", "cutlass" )
		HotKeySet("{F1}")
		$activeWeapon = 1
		Sleep($cutlassinfo[8][1])
		Send("{F1}")
		Sleep(500)
		HotKeySet("{F1}", "idle")
		
		While 1
			If (WinActive("Pirates")) Then
				If $cutlassinfo[2][1] > 0 Then
					If (StringInStr($cutlassinfo[1][1], "1")) Then
						$dif = TimerDiff($beginSweep)
						If ($dif >= 16000) Then
							Send("1")
							$beginSweep = TimerInit()
							Sleep($cutlassinfo[2][1])
						EndIf
					EndIf
					
					If (StringInStr($cutlassinfo[1][1], "2")) Then
						$dif = TimerDiff($beginBrawl)
						If ($dif >= 15000) Then
							Send("2")
							$beginBrawl = TimerInit()
							Sleep($cutlassinfo[2][1])
						EndIf
					EndIf
					
					If (StringInStr($cutlassinfo[1][1], "3")) Then
						$dif = TimerDiff($beginTaunt)
						If ($dif >= 15000) Then
							Send("3")
							$beginTaunt = TimerInit()
							Sleep($cutlassinfo[2][1])
						EndIf
					EndIf
					
					If (StringInStr($cutlassinfo[1][1], "4")) Then
						$dif = TimerDiff($beginStorm)
						If ($dif >= 15000) Then
							Send("4")
							$beginStorm = TimerInit()
							Sleep($cutlassinfo[2][1])
						EndIf
					EndIf
				EndIf
					
				Send("{LCTRL}")
				Sleep($cutlassinfo[3][1])
				
				If ($cutlassinfo[4][1] < 0) Then
					ContinueLoop
				EndIf
				Send("{LCTRL}")
				Sleep($cutlassinfo[4][1])
		
				If ($cutlassinfo[5][1] < 0) Then
					ContinueLoop
				EndIf
				Send("{LCTRL}")
				Sleep($cutlassinfo[5][1])
				
				If ($cutlassinfo[6][1] < 0) Then
					ContinueLoop
				EndIf
				Send("{LCTRL}")
				Sleep($cutlassinfo[6][1])
				
				If ($cutlassinfo[7][1] < 0) Then
					ContinueLoop
				EndIf
				Send("{LCTRL}")
				Sleep($cutlassinfo[7][1])
			EndIf
		WEnd
	EndIf
EndFunc
